//
//  NaviVC.m
//  YiGou
//
//  Created by 李同学 on 2024/10/18.
//

#import "NaviVC.h"

@interface NaviVC ()

@end

@implementation NaviVC


+(void)initialize
{
    UINavigationBar *navBar = [UINavigationBar appearance];

    
    NSDictionary *dict = @{
        NSForegroundColorAttributeName :bet_nav_title_text_color,
        NSFontAttributeName:[UIFont boldSystemFontOfSize:17.f]
    };
    
    if (@available(iOS 15.0, *)) {
        UINavigationBarAppearance *barapp = [UINavigationBarAppearance new];
        barapp.backgroundColor = [UIColor yellowColor];
        [barapp configureWithOpaqueBackground];
        barapp.backgroundEffect = nil;
        navBar.standardAppearance = barapp;
        navBar.scrollEdgeAppearance = barapp;
    }else{
        [navBar setTitleTextAttributes:dict];
        [navBar setShadowImage:[UIImage new]];
    }
    [navBar setShadowImage:[UIImage new]];
    navBar.translucent = NO;
    navBar.barTintColor = bet_nav_bg_color;
    navBar.tintColor = bet_nav_title_text_color;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleDone target:nil action:nil];
    [super pushViewController:viewController animated:animated];
}


@end
